<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="/resources/scaffold/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="page" value="#{klientBean.page}"/>
		<f:event type="preRenderView" listener="#{klientBean.paginate}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Search Klient entities"/>

	<ui:define name="header">
		Klient
	</ui:define>

	<ui:define name="subheader">
		Search Klient entities
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="search">
			<f:validateBean disabled="true">
				<h:panelGroup styleClass="search">

					<h:panelGrid columnClasses="label,component,required" columns="3">
						<h:outputLabel for="klientBeanExampleImie" value="Imie:"/>
						<h:panelGroup>
							<h:inputText id="klientBeanExampleImie" value="#{klientBean.example.imie}"/>
							<h:message for="klientBeanExampleImie" styleClass="error"/>
						</h:panelGroup>
						<h:outputText/>
						<h:outputLabel for="klientBeanExampleNazwisko" value="Nazwisko:"/>
						<h:panelGroup>
							<h:inputText id="klientBeanExampleNazwisko" value="#{klientBean.example.nazwisko}"/>
							<h:message for="klientBeanExampleNazwisko" styleClass="error"/>
						</h:panelGroup>
						<h:outputText/>
						<h:outputLabel for="klientBeanExampleMiasto" value="Miasto:"/>
						<h:panelGroup>
							<h:inputText id="klientBeanExampleMiasto" value="#{klientBean.example.miasto}"/>
							<h:message for="klientBeanExampleMiasto" styleClass="error"/>
						</h:panelGroup>
						<h:outputText/>
						<h:outputLabel for="klientBeanExampleUlica" value="Ulica:"/>
						<h:panelGroup>
							<h:inputText id="klientBeanExampleUlica" value="#{klientBean.example.ulica}"/>
							<h:message for="klientBeanExampleUlica" styleClass="error"/>
						</h:panelGroup>
						<h:outputText/>
						<h:outputLabel for="klientBeanExampleEmail" value="Email:"/>
						<h:panelGroup>
							<h:inputText id="klientBeanExampleEmail" value="#{klientBean.example.email}"/>
							<h:message for="klientBeanExampleEmail" styleClass="error"/>
						</h:panelGroup>
						<h:outputText/>
					</h:panelGrid>
					<h:panelGroup styleClass="buttons">
						<h:commandLink value="Search" action="#{klientBean.search}" styleClass="btn btn-primary"/>
						<h:commandLink value="Create New" action="#{klientBean.create}" styleClass="btn btn-primary"/>
					</h:panelGroup>
				</h:panelGroup>
			</f:validateBean>
			
			<h:dataTable id="klientBeanPageItems" styleClass="data-table" value="#{klientBean.pageItems}" var="_item">
				<h:column>
					<f:facet name="header">
						<h:outputText value="Imie"/>
					</f:facet>
					<h:link outcome="/klient/view">
						<f:param name="id" value="#{_item.id}"/>
						<h:outputText id="itemImie" value="#{_item.imie}"/>
					</h:link>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Nazwisko"/>
					</f:facet>
					<h:link outcome="/klient/view">
						<f:param name="id" value="#{_item.id}"/>
						<h:outputText id="itemNazwisko" value="#{_item.nazwisko}"/>
					</h:link>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Miasto"/>
					</f:facet>
					<h:link outcome="/klient/view">
						<f:param name="id" value="#{_item.id}"/>
						<h:outputText id="itemMiasto" value="#{_item.miasto}"/>
					</h:link>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Ulica"/>
					</f:facet>
					<h:link outcome="/klient/view">
						<f:param name="id" value="#{_item.id}"/>
						<h:outputText id="itemUlica" value="#{_item.ulica}"/>
					</h:link>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Email"/>
					</f:facet>
					<h:link outcome="/klient/view">
						<f:param name="id" value="#{_item.id}"/>
						<h:outputText id="itemEmail" value="#{_item.email}"/>
					</h:link>
				</h:column>
			</h:dataTable>
			<ui:include src="/resources/scaffold/paginator.xhtml">
				<ui:param name="paginatorBean" value="#{klientBean}"/>
			</ui:include>
		</h:form>
			
	</ui:define>

</ui:composition>
